/******************************************************************************
 * (C) Copyright 
 * FILE NAME:    system.h
 * DESCRIPTION:
 * 
 * DATE BEGUN:   
 * BY:           
 * PRODUCT NAME:
 * APPLICATION:
 * TARGET H/W:
 * DOC REF:
 *****************************************************************************
 */

#ifndef _SYSTEM_H_
#define _SYSTEM_H_

/* C12056 - "SP debug info incorrect because of optimization or 
   inline assembler" */
#pragma MESSAGE DISABLE C12056

/* C5917 - "Removed dead assignment"  */
#pragma MESSAGE DISABLE C5917

#include "derivative.h"
#include "Type.h"
#include <hidef.h> 
#include <stdtypes.h>
#include "string.h"

//#include "rtwtypes.h"
#define TRUE 	  1
#define FALSE 	  0
#define ON 		  1
#define OFF 	  0
#define SET 	  1
#define CLEAR 	  0
#define HIGH   	  1
#define LOW 	  0  
#define ENABLE	  1
#define DISABLE   0
#define H 	(0x00)
#define L	(0x01)
#define N	(0x02)

#define BIT0    (0x01)
#define BIT1    (0x02)
#define BIT2    (0x04)
#define BIT3    (0x08)
#define BIT4    (0x10)
#define BIT5    (0x20)
#define BIT6    (0x40)
#define BIT7    (0x80)
#define BIT8    (0x0100)
#define BIT9    (0x0200)
#define BIT10   (0x0400)
#define BIT11   (0x0800)
#define BIT12   (0x1000)
#define BIT13   (0x2000)
#define BIT14   (0x4000)
#define BIT15   (0x8000)


#define FREE       (0xFF)
#define NULL_PTR   ((void *) 0)
#define FARFUNC 
#define TESTBIT( operand, bit_mask )      ((operand) &  (bit_mask))
#define SETBIT( operand, bit_mask )       ((operand) |= (bit_mask))
#define CLEARBIT( operand, bit_mask )     ((operand) &= (~(bit_mask)))
#define TOGGLEBIT( operand, bit_mask )    ((operand) ^= (bit_mask))
#define CLR_BIT(port,bit) ((port) &= ~(1<<(bit)))
#define SET_BIT(port,bit) ((port) |= (1<<(bit)))

void HW_Init(void);
/*****************************************************************************
**  typedef
*****************************************************************************/

#endif	//_SYSTEM_H_

/*****************************************************************************
** End File
*****************************************************************************/
